UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kh0dcM/5EjHZZ040O1w+2nbKyMuJoFiFKGsuTorhzWM=' 
WHERE 
  key_id = 'a648ebb4d230a487db4be5c96194584bba97385c31110dd857572240d5f12460' 
  AND (
    token = 'Kh0dcM/5EjHZZ040O1w+2nbKyMuJoFiFKGsuTorhzWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033