UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd/+PF9z4dhnfd72MEGHgSC3GufShOmqEdafPduDeB/s='
WHERE
key_id = '038ac06637adebf19a712d91753d753cde84e125cae9fde5169920187e80f6ce'
AND (
token = 'd/+PF9z4dhnfd72MEGHgSC3GufShOmqEdafPduDeB/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)