UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+AiN4FBFkX8I9klYZagJyzXAIunxZ4oLJEXPZXEG2s=' 
WHERE 
  key_id = '05e159dee67a2bc261b96578bdfad851020c96185327aafe61f7fb2309f9bc3e' 
  AND (
    token = '2+AiN4FBFkX8I9klYZagJyzXAIunxZ4oLJEXPZXEG2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037