UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sFz5mzOapI6srL+9H/43aMesqpM38fbZ/HoHn50kjIE=' 
WHERE 
  key_id = '8adc63bd443c9654732b0e3c6f651f575e6e0dc3460161039a0042b166ca1d3c' 
  AND (
    token = 'sFz5mzOapI6srL+9H/43aMesqpM38fbZ/HoHn50kjIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029