UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R/M+qnCU/Lul3pYr58+k7MFnKxUEcovuaC92f02xlx8=' 
WHERE 
  key_id = '828424fffd3ef4d9fc430440fcdb38b51760bb91243733a8eea28ecaf80f8fa6' 
  AND (
    token = 'R/M+qnCU/Lul3pYr58+k7MFnKxUEcovuaC92f02xlx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020