UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wfVemTLQUgYTOAbSTdrFSkDV4JIR9lOKNiqYVGcExMw=' 
WHERE 
  key_id = '37fc2e7acd6851644c18a080084c9a4ff4d3003bd77babfbcae0aff5125a3026' 
  AND (
    token = 'wfVemTLQUgYTOAbSTdrFSkDV4JIR9lOKNiqYVGcExMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035