UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BTM9SR9Cft9N3SOoNENsY3M3108dFBSumZPaHOJZ0i0=' 
WHERE 
  key_id = '5e5ded3a7e5d98873eed7e6253d3977094bfab7d059cfbb706734253fbb46e70' 
  AND (
    token = 'BTM9SR9Cft9N3SOoNENsY3M3108dFBSumZPaHOJZ0i0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043