UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M5bhySfHQI3FD74rGrTN2FYxuLBqXQPDP97U/X7gV8A='
WHERE
key_id = 'd30dc1183a6c4ce66e8bb8d75cf6e8d9038c2dec4ab54dfe8da9bf5defad164d'
AND (
token = 'M5bhySfHQI3FD74rGrTN2FYxuLBqXQPDP97U/X7gV8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)