UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FfvZbTefz5U8eLqcbmJ6VcvHkJojNLMZTdtX0nZNl1I=' 
WHERE 
  key_id = '28a30816b2a86daf77aa20d4480a1171626ed0f870933d8088cdf63302385495' 
  AND (
    token = 'FfvZbTefz5U8eLqcbmJ6VcvHkJojNLMZTdtX0nZNl1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022