UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GuaLpi/c1ebHKAwl40KvZqw012IYg7tIS7c2QXZlCGc='
WHERE
key_id = '53d9028bcf72bcb62779464875d1bb6911a99b3b5b4db584df8a6154e0299b52'
AND (
token = 'GuaLpi/c1ebHKAwl40KvZqw012IYg7tIS7c2QXZlCGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)