UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zq/lkDFzKSrr9JboflDP52VQ9QeL6g/R6a/Ib6ZkTio=' 
WHERE 
  key_id = '9e41f875959977fafca0055e29af4cbddab82555607666cec99d004e2092a0f8' 
  AND (
    token = 'zq/lkDFzKSrr9JboflDP52VQ9QeL6g/R6a/Ib6ZkTio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030