UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l783JAeJToSag9piOJ/pLbN8L/hmbCW28eEd7CNs5a0=' 
WHERE 
  key_id = '61abc134460f3ad30a6cef728a6f8a88f6e2668562f331d6bb0f356f326b59d3' 
  AND (
    token = 'l783JAeJToSag9piOJ/pLbN8L/hmbCW28eEd7CNs5a0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053