UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't8DdxprOz3RhRJtESERYavqzV7/28P7GPvaOmwu0FJg='
WHERE
key_id = 'f7fc21b4a5dc300cb64bb331fd4466cd4bd4fc5d86dc91b4b78c27bcfb2ca8e4'
AND (
token = 't8DdxprOz3RhRJtESERYavqzV7/28P7GPvaOmwu0FJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)