UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DVnS0+h76oeLjRjffs5/kgKa9IJ6HrCqkX7I+3BjODw='
WHERE
key_id = '114f986e0e3a626c6af8bc1d02b0c11a71096b2fad64351900e3e7260ff492bb'
AND (
token = 'DVnS0+h76oeLjRjffs5/kgKa9IJ6HrCqkX7I+3BjODw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)