UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JaNQB17KeAEL30pxnB99oFC1H8ACH6bQFE6rPgJrw9I='
WHERE
key_id = '945c7de495a3fffd5f1c9eb3c0bcf7e667be2b4f23156a88aa9aa67bac0c6f21'
AND (
token = 'JaNQB17KeAEL30pxnB99oFC1H8ACH6bQFE6rPgJrw9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)