UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LXMUnv+vIWrAyFnArd5/kw1q9YmBtB/sm08ksJt9rww=' 
WHERE 
  key_id = 'ec48e32ea3264ce7a6a8fef1ca0ff7fa6032f0d75fd97b673946dae09aa24578' 
  AND (
    token = 'LXMUnv+vIWrAyFnArd5/kw1q9YmBtB/sm08ksJt9rww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036