UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yXBX7/FKxIHiuXhTPl1SXWmBmF7H3oIyriJSQ5N9XxM=' 
WHERE 
  key_id = 'f012a3fe9cef269364cae24a42b92dd302e9a8c6277bf87e199ac0d8f19ff34b' 
  AND (
    token = 'yXBX7/FKxIHiuXhTPl1SXWmBmF7H3oIyriJSQ5N9XxM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050