UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RRLPXGYFJdWWg38w2h9HWwB1y9/KfolJMYGwEaOt5eY=' 
WHERE 
  key_id = 'ad4603256759ee5f8797f8b5986b03acc5c055cbc49f0dad6f9b5eb5c3065e46' 
  AND (
    token = 'RRLPXGYFJdWWg38w2h9HWwB1y9/KfolJMYGwEaOt5eY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029