UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBqN/Hv7TdSzCYGGkbTy8ZsfQArqSVEYsThzDY37LsY=' 
WHERE 
  key_id = '4c79680cdf78b9565bab246003c82d76d0105410204130e65319778856a6de74' 
  AND (
    token = 'MBqN/Hv7TdSzCYGGkbTy8ZsfQArqSVEYsThzDY37LsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016