UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3Kab7/lB86vJMaC6wb62DUZ7lg1LyfwEiMpBfj7tOE='
WHERE
key_id = 'ebd6c5bc474b2afa16bba6509e7bb8d58e7e930e7190fcb6af8c3498c1af3073'
AND (
token = 'o3Kab7/lB86vJMaC6wb62DUZ7lg1LyfwEiMpBfj7tOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)