UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '64MuBsTWbV4zdrAi+ht7XYPiz2tJhLBrB8xM0ztKz2M=' 
WHERE 
  key_id = '01c0f9f027e4ffb287ed7ee3d8a7f43b8988a9812ef18f8929e7406d8f355ef8' 
  AND (
    token = '64MuBsTWbV4zdrAi+ht7XYPiz2tJhLBrB8xM0ztKz2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018