UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xmPRBE/nzsPWzdnJZgv8UY1q96bjxaQPtYEqpnGQRSU='
WHERE
key_id = 'd017861b1d5cfa1f20e8c424bea2e8d779af78401552e40b89cdd3c439303f19'
AND (
token = 'xmPRBE/nzsPWzdnJZgv8UY1q96bjxaQPtYEqpnGQRSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)