UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DGy4muPhbJV6v63IjfanydY3j3AVC4+LAgbibvTyljY='
WHERE
key_id = 'bd3ba349b31b169f74f86c2355387442dc354891f278bfe2227c046db99116c2'
AND (
token = 'DGy4muPhbJV6v63IjfanydY3j3AVC4+LAgbibvTyljY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)