UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ypl6X+CVO76uH8IetCKyjNatJ2tVrX9ecSH4DYufC/4='
WHERE
key_id = '36233c1a3748c4b19ff860913bea73bc5e02d20c426ebab04e83488476a8ab56'
AND (
token = 'ypl6X+CVO76uH8IetCKyjNatJ2tVrX9ecSH4DYufC/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)