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

Query time 0.00018