UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kObUu5JSMEI/Nc+TAhNrCoegvpd4lkFn2sUcM+tL/qk=' 
WHERE 
  key_id = '4de94aba420d36b080eac5c1219b6a0f75ff7b3d18d444108d72ae62ec8f1ee7' 
  AND (
    token = 'kObUu5JSMEI/Nc+TAhNrCoegvpd4lkFn2sUcM+tL/qk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024