UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RarKjC+rOd1fENLwHqBHZRXH173+10V0gUEUvDOsGOk='
WHERE
key_id = '30e51b81cc0b4304d3461078577eebfb9886fdeaf7255a1926d3960c57245e21'
AND (
token = 'RarKjC+rOd1fENLwHqBHZRXH173+10V0gUEUvDOsGOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)