UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8POu5Pox8Q7EVYvofK0i1yc3WlOta7ssXzavW1KM6g='
WHERE
key_id = '1ddba14b7789076a14b1b75cd0b44a2f964d590a6618a1f4f727d6302c4ad38a'
AND (
token = 'F8POu5Pox8Q7EVYvofK0i1yc3WlOta7ssXzavW1KM6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)