UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sdu29pDQdIL5vOabgMqKJWcV5qG1Sc4NPW21v5fiJig=' 
WHERE 
  key_id = 'b6f753c229cdaf62758dac390272a2b9cc54fe3c4c6295e46c1bdf083e5d22d7' 
  AND (
    token = 'Sdu29pDQdIL5vOabgMqKJWcV5qG1Sc4NPW21v5fiJig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042