UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ABg8MmJuUl9fHxJy8altzEqyDiYKuaad5MYnWl4gY6I=' 
WHERE 
  key_id = '4a90de9f5f26155377c6f303ef6896431d1ff5ee13c49b9a95ecfce33a12a9ff' 
  AND (
    token = 'ABg8MmJuUl9fHxJy8altzEqyDiYKuaad5MYnWl4gY6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043