UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ORfPIJHhsQHPmRUB4XSt8zmOUHto/5EKBd8ADXOdBJw='
WHERE
key_id = 'b198d4d9738fe512010546d587464d49d3b647a84b8f8c31d0d8888b93b40d9d'
AND (
token = 'ORfPIJHhsQHPmRUB4XSt8zmOUHto/5EKBd8ADXOdBJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)