UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6kKtatenuvKTP0FsKbvw2BIgAwIVHzU/GcJcsCwnYw4='
WHERE
key_id = '80b2304d969bcf343a9155decc85153085606033f85268b5639dc80db5838b64'
AND (
token = '6kKtatenuvKTP0FsKbvw2BIgAwIVHzU/GcJcsCwnYw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)