UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eRJ5OK3GyadjgqkzyKtstlYmtbxhr+I9WYXXyXl1zF0='
WHERE
key_id = '959cffc9a23c0773a7e7fcbe4950a35546e5570d500d6952bfd474215ee47e23'
AND (
token = 'eRJ5OK3GyadjgqkzyKtstlYmtbxhr+I9WYXXyXl1zF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)